package com.loiane.dataaccess;

import java.sql.Connection;
import java.sql.SQLException;

abstract class BaseDataBaseAccessor {

	private static String DB_URL = "jdbc:mysql://localhost:3306/pht";
	protected Connection getConnection(){
		Connection conn = null;
		try {
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			conn = java.sql.DriverManager.getConnection(DB_URL,"root",null);
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		   
		return conn;
	}
}
